home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
Demos
/
Herois
/
Codigo.Cst
/
00076_Script_Lista Alfabetica
< prev
next >
Wrap
Text File
|
1999-03-19
|
2KB
|
58 lines
--
-- Gera lista alfabetica e armazena texto e referencias em
-- ListaAlfabetica e ListaAlfabeticaRef respectivamente
on GeraListaAlfabetica
global V12dbeFact, V12tblFact
set V12dbeFact = Xtra "V12dbe"
set V12tblFact = Xtra "V12table"
abreTextosDB
abreDB
-- Seleciona todos na lista
mSetIndex(gArqs,"alfaNdx")
mSelect(gArqs)
set counter = mSelectCount(gArqs)
-- Prepara lista
set listaAlfabetica = ""
set listaAlfabeticaRef = ""
repeat while counter > 0
-- Le registro
set ai = mGetField(gArqs,"arqNum")
set titulo = "- " & mGetField(gArqs,"arquivo")
-- Tira espaco no final do titulo
set i = length(titulo)
repeat while i > 0 and char i of titulo = SPACE
set i = i - 1
end repeat
set titulo = char 1 to i of titulo
put titulo & RETURN after listaAlfabetica
-- Monta lista de indices
put the number of words in titulo into tmp
repeat while tmp > 0
put String(ai) & ", " after listaAlfabeticaRef
put tmp-1 into tmp
end repeat
-- Proxima pagina
put counter - 1 into counter
mGoNext(gArqs)
end repeat
put "0" & RETURN after listaAlfabeticaRef
set the text of member "ListaAlfabetica" to listaAlfabetica
set the text of member "ListaALfabeticaRef" to listaAlfabeticaRef
-- Por causa de BUG do V12, precisa-se de abrir e fechar
-- gArqs novamente
fechaDB
fechaTextosDB
end
on carregaListaAlfabetica
end